<!DOCTYPE html>
<html>
    <head>
        <title>demo</title>
        <meta charset="utf-8">
        <meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
        <style>
            body {
                font-family: Monospace;
                background-color: #f0f0f0;
                margin: 0px;
                overflow: hidden;
            }
        </style>
    </head>
    <body>
        <script src="https://cdn.bootcdn.net/ajax/libs/three.js/73/three.js"></script>
        <script src="https://cdn.bootcdn.net/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
        <script src="https://cdn.bootcdn.net/ajax/libs/tween.js/0.11.0/Tween.min.js"></script>
		<script src="https://unpkg.com/three@0.73.1/examples/js/controls/TrackballControls.js"></script>
        <script src="https://cdn.bootcdn.net/ajax/libs/stats.js/10/Stats.min.js"></script>
        <script>

            var jsonstr = '[{"boxId":"942617001023436","x":-75.900002,"y":-64.599998,"z":-536.000000,"width":80.000000,"height":130.800003,"length":120.000000,"weight":196.500000,"platform":"platform09","order":1,"material":"","type":1,"place":100},{"boxId":"942617001023426","x":-75.900002,"y":65.400002,"z":-536.000000,"width":80.000000,"height":129.199997,"length":120.000000,"weight":193.000000,"platform":"platform09","order":2,"material":"","type":1,"place":100},{"boxId":"942617001023437","x":4.100000,"y":-65.300003,"z":-536.000000,"width":80.000000,"height":129.399994,"length":120.000000,"weight":190.500000,"platform":"platform09","order":3,"material":"","type":1,"place":100},{"boxId":"942617001023424","x":4.100000,"y":64.000000,"z":-536.000000,"width":80.000000,"height":129.199997,"length":120.000000,"weight":192.500000,"platform":"platform09","order":4,"material":"","type":1,"place":100},{"boxId":"942617001023495","x":72.099998,"y":-100.750000,"z":-552.000000,"width":56.000000,"height":58.500000,"length":88.000000,"weight":123.500000,"platform":"platform09","order":5,"material":"","type":1,"place":100},{"boxId":"942617001023263","x":72.099998,"y":-42.250000,"z":-552.000000,"width":56.000000,"height":58.500000,"length":88.000000,"weight":84.000000,"platform":"platform09","order":6,"material":"","type":1,"place":100},{"boxId":"942617001023348","x":72.099998,"y":16.250000,"z":-552.000000,"width":56.000000,"height":58.500000,"length":88.000000,"weight":74.000000,"platform":"platform09","order":7,"material":"","type":1,"place":100},{"boxId":"942617001023219","x":72.099998,"y":74.750000,"z":-552.000000,"width":56.000000,"height":58.500000,"length":88.000000,"weight":54.500000,"platform":"platform09","order":8,"material":"","type":1,"place":100},{"boxId":"94261700101Z993","x":62.349998,"y":115.750000,"z":-577.250000,"width":36.500000,"height":23.500000,"length":37.500000,"weight":16.799999,"platform":"platform09","order":9,"material":"","type":1,"place":100},{"boxId":"94261700101S812","x":62.349998,"y":115.750000,"z":-539.750000,"width":36.500000,"height":23.500000,"length":37.500000,"weight":14.860000,"platform":"platform09","order":10,"material":"","type":1,"place":100},{"boxId":"942617001023425","x":-75.900002,"y":-65.400002,"z":-416.000000,"width":80.000000,"height":129.199997,"length":120.000000,"weight":191.000000,"platform":"platform09","order":11,"material":"","type":1,"place":100},{"boxId":"942617001023347","x":-75.900002,"y":62.000000,"z":-416.000000,"width":80.000000,"height":125.599998,"length":120.000000,"weight":219.500000,"platform":"platform09","order":12,"material":"","type":1,"place":100},{"boxId":"942617001023442","x":4.100000,"y":-67.400002,"z":-416.000000,"width":80.000000,"height":125.199997,"length":120.000000,"weight":193.500000,"platform":"platform09","order":13,"material":"","type":1,"place":100},{"boxId":"942617001023262","x":4.100000,"y":55.349998,"z":-416.000000,"width":80.000000,"height":120.300003,"length":120.000000,"weight":184.000000,"platform":"platform09","order":14,"material":"","type":1,"place":100},{"boxId":"942617001023215","x":-18.150000,"y":120.500000,"z":-456.750000,"width":35.500000,"height":10.000000,"length":38.500000,"weight":5.700000,"platform":"platform09","order":15,"material":"","type":1,"place":100},{"boxId":"942617001023448","x":17.350000,"y":120.500000,"z":-456.750000,"width":35.500000,"height":10.000000,"length":38.500000,"weight":4.980000,"platform":"platform09","order":16,"material":"","type":1,"place":100},{"boxId":"94261700101T534","x":74.099998,"y":-70.699997,"z":-436.000000,"width":60.000000,"height":118.599998,"length":80.000000,"weight":92.000000,"platform":"platform09","order":17,"material":"","type":1,"place":100},{"boxId":"942617001023047","x":74.099998,"y":30.700001,"z":-436.000000,"width":60.000000,"height":84.199997,"length":80.000000,"weight":37.000000,"platform":"platform09","order":18,"material":"","type":1,"place":100},{"boxId":"942617001023204","x":74.099998,"y":96.900002,"z":-436.000000,"width":60.000000,"height":48.200001,"length":80.000000,"weight":30.500000,"platform":"platform09","order":19,"material":"","type":1,"place":100},{"boxId":"942617001023309","x":-18.150000,"y":120.500000,"z":-418.250000,"width":35.500000,"height":10.000000,"length":38.500000,"weight":4.980000,"platform":"platform09","order":20,"material":"","type":1,"place":100},{"boxId":"942617001023370","x":17.350000,"y":120.500000,"z":-418.250000,"width":35.500000,"height":10.000000,"length":38.500000,"weight":4.860000,"platform":"platform09","order":21,"material":"","type":1,"place":100},{"boxId":"942617001023258","x":-18.150000,"y":120.500000,"z":-379.750000,"width":35.500000,"height":10.000000,"length":38.500000,"weight":4.820000,"platform":"platform09","order":22,"material":"","type":1,"place":100},{"boxId":"942617001023203","x":17.350000,"y":120.500000,"z":-379.750000,"width":35.500000,"height":10.000000,"length":38.500000,"weight":4.440000,"platform":"platform09","order":23,"material":"","type":1,"place":100},{"boxId":"942617001023496","x":74.349998,"y":-108.000000,"z":-376.850006,"width":38.299999,"height":44.000000,"length":60.500000,"weight":32.799999,"platform":"platform09","order":24,"material":"","type":1,"place":200},{"boxId":"942617001020011","x":74.349998,"y":-64.000000,"z":-376.850006,"width":38.299999,"height":44.000000,"length":60.500000,"weight":16.000000,"platform":"platform09","order":25,"material":"","type":1,"place":200},{"boxId":"942617001020083","x":74.349998,"y":-20.000000,"z":-376.850006,"width":38.299999,"height":44.000000,"length":60.500000,"weight":15.000000,"platform":"platform09","order":26,"material":"","type":1,"place":200},{"boxId":"942617001023326","x":74.349998,"y":24.000000,"z":-376.850006,"width":38.299999,"height":44.000000,"length":60.500000,"weight":12.000000,"platform":"platform09","order":27,"material":"","type":1,"place":200},{"boxId":"942617001023142","x":74.349998,"y":68.000000,"z":-376.850006,"width":38.299999,"height":44.000000,"length":60.500000,"weight":10.180000,"platform":"platform09","order":28,"material":"","type":1,"place":200},{"boxId":"942617001023423","x":62.849998,"y":107.500000,"z":-377.250000,"width":37.500000,"height":35.000000,"length":37.500000,"weight":12.080000,"platform":"platform09","order":29,"material":"","type":1,"place":100},{"boxId":"942617001023247","x":-75.900002,"y":-70.000000,"z":-296.000000,"width":80.000000,"height":120.000000,"length":120.000000,"weight":230.000000,"platform":"platform09","order":30,"material":"","type":1,"place":100},{"boxId":"942617001023277","x":-75.900002,"y":49.750000,"z":-296.000000,"width":80.000000,"height":119.500000,"length":120.000000,"weight":172.000000,"platform":"platform09","order":31,"material":"","type":1,"place":100},{"boxId":"942617001023265","x":-97.650002,"y":118.250000,"z":-337.250000,"width":36.500000,"height":17.500000,"length":37.500000,"weight":10.080000,"platform":"platform09","order":32,"material":"","type":1,"place":100},{"boxId":"94261700101S946","x":-61.150002,"y":118.250000,"z":-337.250000,"width":36.500000,"height":17.500000,"length":37.500000,"weight":9.460000,"platform":"platform09","order":33,"material":"","type":1,"place":100},{"boxId":"942617001023272","x":4.100000,"y":-70.599998,"z":-296.000000,"width":80.000000,"height":118.800003,"length":120.000000,"weight":217.000000,"platform":"platform09","order":34,"material":"","type":1,"place":100},{"boxId":"942617001023324","x":4.100000,"y":47.849998,"z":-296.000000,"width":80.000000,"height":118.099998,"length":120.000000,"weight":178.000000,"platform":"platform09","order":35,"material":"","type":1,"place":100},{"boxId":"942617001023237","x":-17.650000,"y":115.650002,"z":-337.250000,"width":36.500000,"height":17.500000,"length":37.500000,"weight":8.680000,"platform":"platform09","order":36,"material":"","type":1,"place":100},{"boxId":"942617001021251","x":18.850000,"y":115.650002,"z":-337.250000,"width":36.500000,"height":17.500000,"length":37.500000,"weight":7.900000,"platform":"platform09","order":37,"material":"","type":1,"place":100},{"boxId":"942617001023148","x":74.099998,"y":-88.000000,"z":-316.000000,"width":60.000000,"height":84.000000,"length":80.000000,"weight":53.500000,"platform":"platform09","order":38,"material":"","type":1,"place":100},{"boxId":"942617001023056","x":74.099998,"y":-4.250000,"z":-316.000000,"width":60.000000,"height":83.500000,"length":80.000000,"weight":48.000000,"platform":"platform09","order":39,"material":"","type":1,"place":100},{"boxId":"942617001023261","x":74.099998,"y":79.250000,"z":-316.000000,"width":60.000000,"height":83.500000,"length":80.000000,"weight":41.500000,"platform":"platform09","order":40,"material":"","type":1,"place":100},{"boxId":"942617001023042","x":-97.650002,"y":118.250000,"z":-299.750000,"width":36.500000,"height":17.500000,"length":37.500000,"weight":7.440000,"platform":"platform09","order":41,"material":"","type":1,"place":100},{"boxId":"94261700101S691","x":-61.150002,"y":118.250000,"z":-299.750000,"width":36.500000,"height":17.500000,"length":37.500000,"weight":6.840000,"platform":"platform09","order":42,"material":"","type":1,"place":100},{"boxId":"942617001023188","x":-17.650000,"y":115.650002,"z":-299.750000,"width":36.500000,"height":17.500000,"length":37.500000,"weight":3.560000,"platform":"platform09","order":43,"material":"","type":1,"place":100},{"boxId":"942617001023248","x":19.850000,"y":111.900002,"z":-300.750000,"width":35.500000,"height":10.000000,"length":38.500000,"weight":3.980000,"platform":"platform09","order":44,"material":"","type":1,"place":200},{"boxId":"942617001023511","x":19.850000,"y":121.900002,"z":-300.750000,"width":35.500000,"height":10.000000,"length":38.500000,"weight":3.760000,"platform":"platform09","order":45,"material":"","type":1,"place":200},{"boxId":"942617001021346","x":-98.150002,"y":114.500000,"z":-261.750000,"width":35.500000,"height":10.000000,"length":38.500000,"weight":2.080000,"platform":"platform09","order":46,"material":"","type":1,"place":100},{"boxId":"942617001023249","x":-98.150002,"y":124.500000,"z":-261.750000,"width":35.500000,"height":10.000000,"length":38.500000,"weight":1.360000,"platform":"platform09","order":47,"material":"","type":1,"place":100},{"boxId":"942617001023301","x":-63.900002,"y":119.500000,"z":-264.500000,"width":33.000000,"height":20.000000,"length":33.000000,"weight":25.639999,"platform":"platform09","order":48,"material":"","type":1,"place":100},{"boxId":"942617001021260","x":74.349998,"y":-108.000000,"z":-256.850006,"width":38.299999,"height":44.000000,"length":60.500000,"weight":10.000000,"platform":"platform09","order":49,"material":"","type":1,"place":200},{"boxId":"942617001023337","x":74.349998,"y":-64.000000,"z":-256.850006,"width":38.299999,"height":44.000000,"length":60.500000,"weight":8.000000,"platform":"platform09","order":50,"material":"","type":1,"place":200},{"boxId":"94261700101Z992","x":62.849998,"y":-24.500000,"z":-257.250000,"width":37.500000,"height":35.000000,"length":37.500000,"weight":10.980000,"platform":"platform09","order":51,"material":"","type":1,"place":100},{"boxId":"942617001023516","x":62.849998,"y":10.500000,"z":-257.250000,"width":37.500000,"height":35.000000,"length":37.500000,"weight":10.960000,"platform":"platform09","order":52,"material":"","type":1,"place":100},{"boxId":"942617001023360","x":62.849998,"y":45.500000,"z":-257.250000,"width":37.500000,"height":35.000000,"length":37.500000,"weight":7.560000,"platform":"platform09","order":53,"material":"","type":1,"place":100},{"boxId":"942617001023514","x":62.849998,"y":80.500000,"z":-257.250000,"width":37.500000,"height":35.000000,"length":37.500000,"weight":6.040000,"platform":"platform09","order":54,"material":"","type":1,"place":100},{"boxId":"942617001023050","x":62.349998,"y":109.750000,"z":-257.250000,"width":36.500000,"height":23.500000,"length":37.500000,"weight":14.380000,"platform":"platform09","order":55,"material":"","type":1,"place":100},{"boxId":"942617001023205","x":-75.900002,"y":-70.949997,"z":-176.000000,"width":80.000000,"height":118.099998,"length":120.000000,"weight":152.500000,"platform":"platform09","order":56,"material":"","type":1,"place":100},{"boxId":"942617001023190","x":-75.900002,"y":47.049999,"z":-176.000000,"width":80.000000,"height":117.900002,"length":120.000000,"weight":173.000000,"platform":"platform09","order":57,"material":"","type":1,"place":100},{"boxId":"942617001021239","x":-97.650002,"y":117.750000,"z":-217.250000,"width":36.500000,"height":23.500000,"length":37.500000,"weight":13.500000,"platform":"platform09","order":58,"material":"","type":1,"place":100},{"boxId":"942617001020039","x":-61.150002,"y":117.750000,"z":-217.250000,"width":36.500000,"height":23.500000,"length":37.500000,"weight":9.160000,"platform":"platform09","order":59,"material":"","type":1,"place":100},{"boxId":"942617001022851","x":4.100000,"y":-71.050003,"z":-176.000000,"width":80.000000,"height":117.900002,"length":120.000000,"weight":173.000000,"platform":"platform09","order":60,"material":"","type":1,"place":100},{"boxId":"942617001023157","x":4.100000,"y":46.599998,"z":-176.000000,"width":80.000000,"height":117.400002,"length":120.000000,"weight":169.500000,"platform":"platform09","order":61,"material":"","type":1,"place":100},{"boxId":"942617001021244","x":-17.650000,"y":117.050003,"z":-217.250000,"width":36.500000,"height":23.500000,"length":37.500000,"weight":8.260000,"platform":"platform09","order":62,"material":"","type":1,"place":100},{"boxId":"942617001023571","x":18.850000,"y":117.050003,"z":-217.250000,"width":36.500000,"height":23.500000,"length":37.500000,"weight":7.080000,"platform":"platform09","order":63,"material":"","type":1,"place":100},{"boxId":"942617001023206","x":74.099998,"y":-106.250000,"z":-196.000000,"width":60.000000,"height":47.500000,"length":80.000000,"weight":33.500000,"platform":"platform09","order":64,"material":"","type":1,"place":100},{"boxId":"942617001023061","x":74.099998,"y":-47.750000,"z":-196.500000,"width":60.000000,"height":69.500000,"length":79.000000,"weight":89.500000,"platform":"platform09","order":65,"material":"","type":1,"place":100},{"boxId":"942617001023369","x":74.099998,"y":21.750000,"z":-196.500000,"width":60.000000,"height":69.500000,"length":79.000000,"weight":88.000000,"platform":"platform09","order":66,"material":"","type":1,"place":100},{"boxId":"942617001023008","x":72.099998,"y":93.000000,"z":-199.500000,"width":56.000000,"height":73.000000,"length":73.000000,"weight":173.100006,"platform":"platform09","order":67,"material":"","type":1,"place":100},{"boxId":"94261700101T908","x":-97.650002,"y":117.750000,"z":-179.750000,"width":36.500000,"height":23.500000,"length":37.500000,"weight":6.440000,"platform":"platform09","order":68,"material":"","type":1,"place":100},{"boxId":"942617001022743","x":-61.150002,"y":117.750000,"z":-179.750000,"width":36.500000,"height":23.500000,"length":37.500000,"weight":6.000000,"platform":"platform09","order":69,"material":"","type":1,"place":100},{"boxId":"942617001021347","x":73.599998,"y":-114.500000,"z":-136.500000,"width":39.000000,"height":31.000000,"length":59.000000,"weight":8.720000,"platform":"platform09","order":70,"material":"","type":1,"place":200},{"boxId":"942617001023501","x":62.849998,"y":-81.500000,"z":-137.250000,"width":37.500000,"height":35.000000,"length":37.500000,"weight":5.140000,"platform":"platform09","order":71,"material":"","type":1,"place":100},{"boxId":"942617001023055","x":62.849998,"y":-46.500000,"z":-137.250000,"width":37.500000,"height":35.000000,"length":37.500000,"weight":4.820000,"platform":"platform09","order":72,"material":"","type":1,"place":100},{"boxId":"942617001023048","x":62.849998,"y":-11.500000,"z":-137.250000,"width":37.500000,"height":35.000000,"length":37.500000,"weight":4.740000,"platform":"platform09","order":73,"material":"","type":1,"place":100},{"boxId":"942617001023137","x":-75.900002,"y":-71.300003,"z":-56.000000,"width":80.000000,"height":117.400002,"length":120.000000,"weight":169.000000,"platform":"platform09","order":74,"material":"","type":1,"place":100},{"boxId":"942617001023250","x":-75.900002,"y":46.000000,"z":-56.000000,"width":80.000000,"height":117.199997,"length":120.000000,"weight":134.000000,"platform":"platform09","order":75,"material":"","type":1,"place":100},{"boxId":"942617001023492","x":4.100000,"y":-71.650002,"z":-56.000000,"width":80.000000,"height":116.699997,"length":120.000000,"weight":169.000000,"platform":"platform09","order":76,"material":"","type":1,"place":100},{"boxId":"942617001023155","x":4.100000,"y":45.049999,"z":-56.000000,"width":80.000000,"height":116.699997,"length":120.000000,"weight":131.000000,"platform":"platform09","order":77,"material":"","type":1,"place":100},{"boxId":"942617001023032","x":72.099998,"y":-93.000000,"z":-79.000000,"width":56.000000,"height":74.000000,"length":74.000000,"weight":249.600006,"platform":"platform09","order":78,"material":"","type":1,"place":100},{"boxId":"942617001023031","x":72.099998,"y":-19.000000,"z":-79.000000,"width":56.000000,"height":74.000000,"length":74.000000,"weight":249.399994,"platform":"platform09","order":79,"material":"","type":1,"place":100},{"boxId":"942617001023034","x":72.099998,"y":55.000000,"z":-79.000000,"width":56.000000,"height":74.000000,"length":74.000000,"weight":247.199997,"platform":"platform09","order":80,"material":"","type":1,"place":100},{"boxId":"942617001022964","x":74.099998,"y":-100.000000,"z":-20.000000,"width":44.000000,"height":60.000000,"length":60.000000,"weight":95.400002,"platform":"platform09","order":81,"material":"","type":1,"place":200},{"boxId":"942617001023207","x":-75.900002,"y":-71.650002,"z":64.000000,"width":80.000000,"height":116.699997,"length":120.000000,"weight":117.500000,"platform":"platform09","order":82,"material":"","type":1,"place":100},{"boxId":"942617001023189","x":-75.900002,"y":44.950001,"z":64.000000,"width":80.000000,"height":116.500000,"length":120.000000,"weight":168.500000,"platform":"platform09","order":83,"material":"","type":1,"place":100},{"boxId":"942617001023589","x":4.100000,"y":-76.949997,"z":64.000000,"width":80.000000,"height":106.099998,"length":120.000000,"weight":157.000000,"platform":"platform09","order":84,"material":"","type":1,"place":100},{"boxId":"942617001023520","x":4.100000,"y":28.799999,"z":64.000000,"width":80.000000,"height":105.400002,"length":120.000000,"weight":156.000000,"platform":"platform09","order":85,"material":"","type":1,"place":100},{"boxId":"942617001021356","x":4.100000,"y":105.599998,"z":64.000000,"width":80.000000,"height":48.200001,"length":120.000000,"weight":68.000000,"platform":"platform09","order":86,"material":"","type":1,"place":100},{"boxId":"942617001023033","x":72.099998,"y":-93.000000,"z":41.000000,"width":56.000000,"height":74.000000,"length":74.000000,"weight":246.800003,"platform":"platform09","order":87,"material":"","type":1,"place":100},{"boxId":"942617001022972","x":72.099998,"y":-19.000000,"z":41.000000,"width":56.000000,"height":74.000000,"length":74.000000,"weight":134.399994,"platform":"platform09","order":88,"material":"","type":1,"place":100},{"boxId":"942617001022960","x":72.099998,"y":54.500000,"z":40.500000,"width":56.000000,"height":73.000000,"length":73.000000,"weight":172.500000,"platform":"platform09","order":89,"material":"","type":1,"place":100},{"boxId":"942617001023519","x":-75.900002,"y":-78.699997,"z":184.000000,"width":80.000000,"height":102.599998,"length":120.000000,"weight":149.000000,"platform":"platform09","order":90,"material":"","type":1,"place":100},{"boxId":"942617001023503","x":-75.900002,"y":17.750000,"z":184.000000,"width":80.000000,"height":90.300003,"length":120.000000,"weight":126.500000,"platform":"platform09","order":91,"material":"","type":1,"place":100},{"boxId":"942617001022998","x":-75.900002,"y":95.150002,"z":184.000000,"width":80.000000,"height":64.500000,"length":120.000000,"weight":181.500000,"platform":"platform09","order":92,"material":"","type":1,"place":100},{"boxId":"942617001023441","x":4.100000,"y":-85.400002,"z":184.000000,"width":80.000000,"height":89.199997,"length":120.000000,"weight":115.500000,"platform":"platform09","order":93,"material":"","type":1,"place":100},{"boxId":"942617001023346","x":4.100000,"y":3.650000,"z":184.000000,"width":80.000000,"height":88.900002,"length":120.000000,"weight":405.500000,"platform":"platform09","order":94,"material":"","type":1,"place":100},{"boxId":"94261700101T569","x":4.100000,"y":88.349998,"z":184.000000,"width":80.000000,"height":80.500000,"length":120.000000,"weight":119.500000,"platform":"platform09","order":95,"material":"","type":1,"place":100},{"boxId":"942617001022965","x":72.099998,"y":-93.500000,"z":160.500000,"width":56.000000,"height":73.000000,"length":73.000000,"weight":171.600006,"platform":"platform09","order":96,"material":"","type":1,"place":100},{"boxId":"942617001022963","x":72.099998,"y":-20.500000,"z":160.500000,"width":56.000000,"height":73.000000,"length":73.000000,"weight":171.399994,"platform":"platform09","order":97,"material":"","type":1,"place":100},{"boxId":"942617001022962","x":72.099998,"y":52.500000,"z":160.500000,"width":56.000000,"height":73.000000,"length":73.000000,"weight":171.399994,"platform":"platform09","order":98,"material":"","type":1,"place":100},{"boxId":"942617001023521","x":-75.900002,"y":-85.750000,"z":304.000000,"width":80.000000,"height":88.500000,"length":120.000000,"weight":379.500000,"platform":"platform09","order":99,"material":"","type":1,"place":100},{"boxId":"942617001023490","x":-75.900002,"y":2.050000,"z":304.000000,"width":80.000000,"height":87.099998,"length":120.000000,"weight":149.500000,"platform":"platform09","order":100,"material":"","type":1,"place":100},{"boxId":"942617001023588","x":-75.900002,"y":87.699997,"z":304.000000,"width":80.000000,"height":84.199997,"length":120.000000,"weight":124.000000,"platform":"platform09","order":101,"material":"","type":1,"place":100},{"boxId":"942617001023359","x":4.100000,"y":-86.800003,"z":304.000000,"width":80.000000,"height":86.400002,"length":120.000000,"weight":148.000000,"platform":"platform09","order":102,"material":"","type":1,"place":100},{"boxId":"942617001023518","x":4.100000,"y":-1.850000,"z":304.000000,"width":80.000000,"height":83.500000,"length":120.000000,"weight":123.500000,"platform":"platform09","order":103,"material":"","type":1,"place":100},{"boxId":"94261700101T613","x":4.100000,"y":81.550003,"z":304.000000,"width":80.000000,"height":83.300003,"length":120.000000,"weight":116.500000,"platform":"platform09","order":104,"material":"","type":1,"place":100},{"boxId":"942617001022969","x":72.099998,"y":-93.500000,"z":280.500000,"width":56.000000,"height":73.000000,"length":73.000000,"weight":171.100006,"platform":"platform09","order":105,"material":"","type":1,"place":100},{"boxId":"942617001022961","x":72.099998,"y":-20.500000,"z":280.500000,"width":56.000000,"height":73.000000,"length":73.000000,"weight":171.000000,"platform":"platform09","order":106,"material":"","type":1,"place":100},{"boxId":"942617001022968","x":72.099998,"y":52.500000,"z":280.500000,"width":56.000000,"height":73.000000,"length":73.000000,"weight":170.699997,"platform":"platform09","order":107,"material":"","type":1,"place":100},{"boxId":"942617001023146","x":-75.900002,"y":-88.599998,"z":424.000000,"width":80.000000,"height":82.800003,"length":120.000000,"weight":154.500000,"platform":"platform09","order":108,"material":"","type":1,"place":100},{"boxId":"942617001023054","x":-75.900002,"y":-5.800000,"z":424.000000,"width":80.000000,"height":82.800003,"length":120.000000,"weight":94.500000,"platform":"platform09","order":109,"material":"","type":1,"place":100},{"boxId":"942617001023325","x":-75.900002,"y":76.650002,"z":424.000000,"width":80.000000,"height":82.099998,"length":120.000000,"weight":124.500000,"platform":"platform09","order":110,"material":"","type":1,"place":100},{"boxId":"942617001023278","x":4.100000,"y":-88.949997,"z":424.000000,"width":80.000000,"height":82.099998,"length":120.000000,"weight":123.000000,"platform":"platform09","order":111,"material":"","type":1,"place":100},{"boxId":"942617001023358","x":4.100000,"y":-14.250000,"z":424.000000,"width":80.000000,"height":67.300003,"length":120.000000,"weight":288.000000,"platform":"platform09","order":112,"material":"","type":1,"place":100},{"boxId":"942617001022997","x":4.100000,"y":51.650002,"z":424.000000,"width":80.000000,"height":64.500000,"length":120.000000,"weight":181.000000,"platform":"platform09","order":113,"material":"","type":1,"place":100},{"boxId":"942617001023023","x":-15.650000,"y":103.150002,"z":403.250000,"width":40.500000,"height":38.500000,"length":78.500000,"weight":25.500000,"platform":"platform09","order":114,"material":"","type":1,"place":100},{"boxId":"942617001023010","x":72.099998,"y":-93.500000,"z":400.500000,"width":56.000000,"height":73.000000,"length":73.000000,"weight":170.199997,"platform":"platform09","order":115,"material":"","type":1,"place":100},{"boxId":"942617001022966","x":72.099998,"y":-20.500000,"z":400.500000,"width":56.000000,"height":73.000000,"length":73.000000,"weight":170.100006,"platform":"platform09","order":116,"material":"","type":1,"place":100},{"boxId":"942617001023009","x":72.099998,"y":52.500000,"z":400.500000,"width":56.000000,"height":73.000000,"length":73.000000,"weight":170.000000,"platform":"platform09","order":117,"material":"","type":1,"place":100},{"boxId":"942617001023245","x":3.350000,"y":103.150002,"z":462.750000,"width":40.500000,"height":38.500000,"length":78.500000,"weight":25.000000,"platform":"platform09","order":118,"material":"","type":1,"place":200},{"boxId":"942617001023494","x":-77.400002,"y":-71.300003,"z":522.500000,"width":77.000000,"height":117.400002,"length":77.000000,"weight":377.000000,"platform":"platform09","order":119,"material":"","type":1,"place":100},{"boxId":"942617001021361","x":-77.400002,"y":40.799999,"z":522.500000,"width":77.000000,"height":106.800003,"length":77.000000,"weight":100.000000,"platform":"platform09","order":120,"material":"","type":1,"place":100},{"boxId":"942617001023411","x":24.100000,"y":-97.750000,"z":524.000000,"width":80.000000,"height":64.500000,"length":120.000000,"weight":180.500000,"platform":"platform09","order":121,"material":"","type":1,"place":200},{"boxId":"942617001023409","x":24.100000,"y":-33.250000,"z":524.000000,"width":80.000000,"height":64.500000,"length":120.000000,"weight":180.500000,"platform":"platform09","order":122,"material":"","type":1,"place":200},{"boxId":"942617001023410","x":24.100000,"y":31.250000,"z":524.000000,"width":80.000000,"height":64.500000,"length":120.000000,"weight":180.000000,"platform":"platform09","order":123,"material":"","type":1,"place":200},{"boxId":"942617001023412","x":24.100000,"y":95.750000,"z":524.000000,"width":80.000000,"height":64.500000,"length":120.000000,"weight":179.000000,"platform":"platform09","order":124,"material":"","type":1,"place":200}]';
			var jsonstr2 = '{"container_length":1192.000000,"container_width":231.800003,"container_height":260.000000,"container_max_load":18000.000000,"container_type_name":"40HQ"}'
            var objectArray= JSON.parse(jsonstr);
			var truckJsonObj = JSON.parse(jsonstr2);
            var container, stats;
            var camera, controls, scene, projector, renderer;
            var objects = [], plane;
            var mouse = new THREE.Vector2(), offset = new THREE.Vector3(), INTERSECTED, SELECTED; 
            init();
            animate();
            function init() {
                container = document.createElement( 'div' );
                document.body.appendChild( container );
                camera = new THREE.PerspectiveCamera( 70, window.innerWidth / window.innerHeight, 1, 10000 );
                camera.position.x = -600;
                camera.position.y = 400;
                camera.position.z = 1000;
                controls = new THREE.TrackballControls( camera );
                controls.rotateSpeed = 1.0;
                controls.zoomSpeed = 1.2;
                controls.panSpeed = 0.8;
                controls.noZoom = false;
                controls.noPan = true;
                controls.staticMoving = false;
                controls.dynamicDampingFactor = 0.3;
                scene = new THREE.Scene();
                var ambientLight = new THREE.AmbientLight( Math.random() *0xffffff );
                scene.add( ambientLight );
                var directionalLight = new THREE.DirectionalLight( Math.random() * 0xffffff );
                directionalLight.position.set( 0, 1, 0 );
                scene.add( directionalLight );
                var pointLight = new THREE.PointLight( 0xff0000, 1, 500 );
                pointLight.position.set( 0, 0, -200 );
                scene.add( pointLight );

                container_length = truckJsonObj.container_length;
                container_width = truckJsonObj.container_width;
                container_height = truckJsonObj.container_height;
                var cube_1 = new THREE.Mesh(
                    new THREE.BoxGeometry( container_width, container_height, container_length, 1,1,1 ), 
                    new THREE.MeshBasicMaterial( { color:0xefb73e, wireframe:true } )
                );
                cube_1.position.x = 0;
                cube_1.position.y = 0;
                cube_1.position.z = 0;
                scene.add( cube_1 );

                truck_head_length = 145;
                var truck_head_1 = new THREE.Mesh(
                    new THREE.BoxGeometry( 200, 100, truck_head_length, 1, 1, 5 ), 
                    new THREE.MeshBasicMaterial( { color: 0xffffff, wireframe:true } )
                );
                truck_head_1.position.x = 0;
                truck_head_1.position.y = -50;
                truck_head_1.position.z = -(container_length/2 + truck_head_length/2);
                scene.add( truck_head_1 );
                
                truck_head_length_2 = 80;
                var truck_head_2 = new THREE.Mesh(
                    new THREE.BoxGeometry( 170, 60, truck_head_length_2, 1, 0, 5 ), 
                    new THREE.MeshBasicMaterial( { color: 0xffffff, wireframe:true } )
                );
                truck_head_2.position.x = 0;
                truck_head_2.position.y = 30;
                truck_head_2.position.z = -(container_length/2 + truck_head_length_2/2);
                scene.add( truck_head_2 );
                
                truck_head_chimney_radius = 7;
                var truck_head_chimney1 = new THREE.Mesh(
                    new THREE.CylinderGeometry( truck_head_chimney_radius, truck_head_chimney_radius, 300, 20 ), 
                    new THREE.MeshBasicMaterial( { color:0xffffff, wireframe:true } )
                );
                truck_head_chimney1.position.x = 100;
                truck_head_chimney1.position.y = 50;
                truck_head_chimney1.position.z = -(container_length/2 + truck_head_chimney_radius/2);
                scene.add( truck_head_chimney1 );
                
                var truck_head_chimney2 = new THREE.Mesh(
                    new THREE.CylinderGeometry( truck_head_chimney_radius, truck_head_chimney_radius, 300, 20 ), 
                    new THREE.MeshBasicMaterial( { color:0xffffff, wireframe:true } )
                );
                truck_head_chimney2.position.x = -100;
                truck_head_chimney2.position.y = 50;
                truck_head_chimney2.position.z = -(container_length/2 + truck_head_chimney_radius/2);
                scene.add( truck_head_chimney2 );
        
                var truck_wheel_1 = new THREE.Mesh(new THREE.CylinderGeometry( 50, 50, 20, 50 ), 
                    new THREE.MeshBasicMaterial( { color:0xffffff, wireframe:true } )
                );
                truck_wheel_1.position.x = 110;
                truck_wheel_1.position.y = -100;
                truck_wheel_1.position.z = -(container_length/2 + truck_head_length_2/2 + 20) ;
                truck_wheel_1.rotation.x = 0;
                truck_wheel_1.rotation.y = 0;
                truck_wheel_1.rotation.z = 1.6;
                scene.add( truck_wheel_1 );
                
                var truck_wheel_2 = new THREE.Mesh(new THREE.CylinderGeometry( 50, 50, 20, 50 ), 
                    new THREE.MeshBasicMaterial( { color:0xffffff, wireframe:true } )
                );
                truck_wheel_2.position.x = -110;
                truck_wheel_2.position.y = -100;
                truck_wheel_2.position.z = -(container_length/2 + truck_head_length_2/2 + 20);
                truck_wheel_2.rotation.x = 0;
                truck_wheel_2.rotation.y = 0;
                truck_wheel_2.rotation.z = 1.6;
                scene.add( truck_wheel_2 );

                offset_2 = -240;
                var truck_wheel_5 = new THREE.Mesh(new THREE.CylinderGeometry( 50, 50, 20, 50 ), 
                    new THREE.MeshBasicMaterial( { color:0xffffff, wireframe:true } )
                );
                truck_wheel_5.position.x = container_width/2 + 5;
                truck_wheel_5.position.y = -100;
                truck_wheel_5.position.z = (container_length/2 + truck_head_length_2/2 + offset_2) ;
                truck_wheel_5.rotation.x = 0;
                truck_wheel_5.rotation.y = 0;
                truck_wheel_5.rotation.z = 1.6;
                scene.add( truck_wheel_5 );

                var truck_wheel_6 = new THREE.Mesh(new THREE.CylinderGeometry( 50, 50, 20, 50 ), 
                    new THREE.MeshBasicMaterial( { color:0xffffff, wireframe:true } )
                );
                truck_wheel_6.position.x = -container_width/2 - 5;
                truck_wheel_6.position.y = -100;
                truck_wheel_6.position.z = (container_length/2 + truck_head_length_2/2 + offset_2);
                truck_wheel_6.rotation.x = 0;
                truck_wheel_6.rotation.y = 0;
                truck_wheel_6.rotation.z = 1.6;
                scene.add( truck_wheel_6 );

                for (var i in objectArray) {
                    if (objectArray[i].type==2) {
						var cylinderTopR = objectArray[i].length / 2;
						var cylinderHeight = objectArray[i].height;
						if (objectArray[i].place == 1 || objectArray[i].place == 2)
						{
							cylinderHeight = objectArray[i].width;
						}
						
                        var object2 = new THREE.Mesh(
						    new THREE.CylinderGeometry(cylinderTopR, cylinderTopR, cylinderHeight, 60),
                            new THREE.MeshBasicMaterial( { color: Math.random() * 0xffffff , wireframe:false } ) 
                        ); 
                        object2.position.x = objectArray[i].x;
                        object2.position.y = objectArray[i].y;
                        object2.position.z = objectArray[i].z;
                        if (objectArray[i].place==1) {
                            object2.rotation.z = 55;
                        }
                        if (objectArray[i].place==2) {
                            object2.rotation.x = 55;
                        }
                        object2.width = objectArray[i].width;
                        object2.height = objectArray[i].height;
                        object2.length = objectArray[i].length;
                        object2.weight = objectArray[i].weight;
                        object2.platform = objectArray[i].platform;
                        object2.order = objectArray[i].order;
                        object2.materialInfo = objectArray[i].material;
                        object2.boxId = objectArray[i].boxId;
                        object2.type = objectArray[i].type;
                        object2.place = objectArray[i].place;
                        scene.add( object2 );
                        objects.push( object2 );
                    }
                    if (objectArray[i].type==1) {
						if (objectArray[i].place == 200)
						{
							var box_length = objectArray[i].width;
                            var box_width = objectArray[i].length;
						}
						else
						{
							var box_length = objectArray[i].length;
							var box_width = objectArray[i].width;
						}
						var box_height = objectArray[i].height;
                        var object = new THREE.Mesh(
                            new THREE.BoxGeometry( box_width, box_height, box_length, 1, 1, 1 ), 
                            new THREE.MeshBasicMaterial( { color: Math.random() * 0xffffff , wireframe:false } ) 
                        ); 
                        object.position.x = objectArray[i].x;
                        object.position.y = objectArray[i].y;
                        object.position.z = objectArray[i].z;
						object.length = objectArray[i].length;
						object.width = objectArray[i].width;
						object.height = objectArray[i].height;
                        object.weight = objectArray[i].weight;
                        object.platform = objectArray[i].platform;
                        object.order = objectArray[i].order;
                        object.materialInfo = objectArray[i].material;
                        object.boxId = objectArray[i].boxId;
                        object.type = objectArray[i].type;
                        object.place = objectArray[i].place;
                        scene.add( object );
                        objects.push( object );
                    }
                }

                plane = new THREE.Mesh(
                    new THREE.PlaneGeometry( 2000, 2000, 8, 8 ),
                    new THREE.MeshBasicMaterial( { color: 0x000000, opacity: 0.25, transparent: true, wireframe: true } )
                );
                plane.visible = true;
                scene.add( plane );
                projector = new THREE.Projector();
                renderer = new THREE.WebGLRenderer( { antialias: true } );
                renderer.sortObjects = false;
                renderer.setSize( window.innerWidth, window.innerHeight );
                renderer.shadowMapEnabled = true;
                renderer.shadowMapType = THREE.PCFShadowMap;
                container.appendChild( renderer.domElement );

                stats = new Stats();
                stats.domElement.style.position = 'absolute';
                stats.domElement.style.top = '0px';
                container.appendChild( stats.domElement );

                window.addEventListener( 'resize', onWindowResize, false );
                renderer.domElement.addEventListener( 'mousemove', onDocumentMouseMove, false );
                renderer.domElement.addEventListener( 'mousedown', onDocumentMouseDown, false );
                renderer.domElement.addEventListener( 'mouseup', onDocumentMouseUp, false );
            }

            function onDocumentMouseMove( event ) {
                event.preventDefault();
                mouse.x = ( event.clientX / window.innerWidth ) * 2 - 1;
                mouse.y = - ( event.clientY / window.innerHeight ) * 2 + 1;
                var vector = new THREE.Vector3( mouse.x, mouse.y, 0.5 );
                projector.unprojectVector( vector, camera );
                var raycaster = new THREE.Raycaster( camera.position, vector.sub( camera.position ).normalize() );
                var intersects = raycaster.intersectObjects( objects );
                if ( intersects.length > 0 ) {
                    if ( INTERSECTED != intersects[ 0 ].object ) {
                        INTERSECTED = intersects[ 0 ].object;
                        plane.position.copy( INTERSECTED.position );
                        plane.lookAt( camera.position );
                    }
                    container.style.cursor = 'pointer';
                } else {
                    container.style.cursor = 'auto';
                }
            }

            function onDocumentMouseDown( event ) {
                event.preventDefault();
                var vector = new THREE.Vector3( mouse.x, mouse.y, 0.5 );
                projector.unprojectVector( vector, camera );
                var raycaster = new THREE.Raycaster( camera.position, vector.sub( camera.position ).normalize() );
                var intersects = raycaster.intersectObjects( objects );
                if ( intersects.length > 0 ) {
                    controls.enabled = false;  
                    SELECTED = intersects[ 0 ].object;
                    var info = '<B>' + 
                        'boxId: ' + SELECTED.boxId +
                        '</br> x: ' + SELECTED.position.x + 
                        '</br> y: ' + SELECTED.position.y + 
                        '</br> z: ' + SELECTED.position.z + 
                        '</br> width: ' + SELECTED.width + 
                        '</br> height: ' + SELECTED.height + 
                        '</br> length: ' + SELECTED.length + 
                        '</br> weight: ' + SELECTED.weight +
                        '</br> platform: ' + SELECTED.platform +
                        '</br> order: ' + SELECTED.order +
                        '</br> material: ' + SELECTED.materialInfo + 
                        '</br> type: ' + SELECTED.type + 
                        '</br> place: ' + SELECTED.place + 
                        '</B>' +
                        '</br>' + 
                        '--------------------------' + 
                        '</br>' +
                        'type(1:箱体 2:圆柱体)' +
                        '</br>' +
                        'place(1:品字型 2:田字型)';
                    $("#objectInfo").html(info);
                }
            }

            function onDocumentMouseUp( event ) {
                event.preventDefault();
                controls.enabled = true;
                if ( INTERSECTED ) {
                    plane.position.copy( INTERSECTED.position );
                    SELECTED = null;
                }
                container.style.cursor = 'auto';
            }

            function onWindowResize() {
                camera.aspect = window.innerWidth / window.innerHeight;
                camera.updateProjectionMatrix();
                renderer.setSize( window.innerWidth, window.innerHeight );
            }

            function animate() {
                requestAnimationFrame( animate );
                render();
                stats.update();
            }

            function render() {
                controls.update();
                renderer.render( scene, camera );
            }

        </script>
        <div id="objectInfo" class="a2"><br/>点击物体获取相关属性</div>
        <style>
            .a2{position:absolute; left:20px; top:50px; bottom:0px; width:180px; height:250px; z-index:9999; background: #00FFFF; font-weight:bold; }
        </style>
    </body>
</html>